﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cache
{
  public  class CustomCache
    {

        private static Dictionary<string, object> CustomCacheDictioary = new Dictionary<string, object>();

        public static void Add(string key, object value)
        {
            CustomCacheDictioary.Add(key, value);

        }

        public static T Get<T>(string key)
        {
                return (T)CustomCacheDictioary[key];
           
        }

        public static bool Exists(string key)
        {
            return CustomCacheDictioary.ContainsKey(key);
        }
        public static void RemoveAll()
        {
            CustomCacheDictioary.Clear();
        }

    }
}
